package com.zl.springcloudfeignserver;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: ZhangLiang
 * @Date: 2021/08/23/22:15
 * @Description:
 */
@FeignClient(value = "eureka-client",fallback = EurekaClient.EurekaClientFallback.class)
public interface EurekaClient {

    @GetMapping(value = "/hi")
    String sayHiFromClientOne(@RequestParam(value = "name") String name);


    @Component
    static class EurekaClientFallback implements EurekaClient {

        @Override
        public String sayHiFromClientOne(String name) {
            return "hi,"+name+",我断了";
        }
    }

//    Feign Client 端通过使用@SpringQueryMapComments 来使用Params实体类
//    @GetMapping(path = "/demo")
//    String demoEndpoint(@SpringQueryMap Params params);
}
